<?php
include '../control/mysql.php';
	
	$name = $_GET[name];
	$time = $_GET[time];
	$station = $_GET[station];
	$tempid;
// 	if ($name ==null){
// 		echo "为空!";
// 	}
// 	if ($time ==null){
// 		echo "为空!";
// 	}
// 	if ($station ==null){
// 		echo "为空!";
// 	}
	
	switch ($station){
		case "借、还、分书岗" :
			$station="a0";
			break;
		case "上书岗":
			$station="a1";
			break;
		case "书库管理岗":
			$station="a2";
			break;
		case "报刊岗":
			$station="a3";
			break;
		case "机动岗":
			$station="a4";
			break;
		case "小循环":
			$station="a9";
			break;
	}
	
	mysql_query("set names utf8");
	$sql = "select studentid from allstudent where studentname = '$name'";
	$res_name = mysql_query($sql);
	if ($res_name != null){
		$row=mysql_fetch_array($res_name);
		$tempid=$row[0];
	}
	$sql = "INSERT INTO worktable VALUES ('$tempid','$station','$time')";
	$res = mysql_query($sql);
	if($res == false){
		echo "shibai";
	}else echo "成功插入";
?>